<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-for 指令</title>
    <!--引用vue的两种方式-->
    <!--<script src="https://unpkg.com/vue/dist/vue.js"></script>-->
    <script src="../../../vuejs/vue.js"></script>
</head>
<body>
<div id="app">
    <button v-on:click="me">增加(方法1)</button>
    <button v-on:click="counter+=1">增加(方法2)</button>
    <p>这个按钮被点击了 {{ counter }} 次。</p>
</div>
</body>
<script>
    new Vue({
        el: '#app',
        data: {
            counter: 0
        },
        methods: {
            me: function () {
                this.counter += 1;
            }
        }
    })
</script>
</html>